package com.example.quartzdemo.job;

import lombok.extern.log4j.Log4j2;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 简单任务1
 */
@Component
@Log4j2
public class SimpleTask1 implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
//        JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
//        log.info("{} 定时任务参数：{}", "SimpleTask1", jobDataMap.getString("taskName"));
        log.info("{} 定时任务执行时间：{}", "SimpleTask1", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
    }
}
